<?php

namespace App\Event;

use App\Model\CallBase;

/**
 * 挂断语音事件
 */
class HangupCallEvent
{
    public $userId;
    public $answerUserId;
    public $callDuration; //语聊时长(s)
    public $eventType = 'hangup_call';
    public $callType = 'call';

    public function __construct(
        $userId = 0,
        $answerUserId = 0,
        $callDuration = 0,
        $callFrom = 1,
        $callMark = 1
    ) {
        $this->userId = $userId;
        $this->answerUserId = $answerUserId;
        $this->callDuration = $callDuration;
        if ($callFrom == CallBase::FROM_DAILY_FREE && $callMark == 2) {
            $this->callType = 'daily_free_host';
        }
    }
}
